<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>后台管理系统</title>
<meta name="author" content="DeathGhost" />
<link rel="stylesheet" href="css/style.css" type="text/css"></link>
<script src="js/jquery.js"></script>
<script src="js/jquery.mCustomScrollbar.concat.min.js"></script>
<script>
	(function($) {
		$(window).load(
				function() {

					$("a[rel='load-content']").click(
							function(e) {
								e.preventDefault();
								var url = $(this).attr("href");
								$.get(url, function(data) {
									$(".content .mCSB_container").append(data); //load new content inside .mCSB_container
									//scroll-to appended content 
									$(".content").mCustomScrollbar("scrollTo",
											"h2:last");
								});
							});

					$(".content").delegate(
							"a[href='top']",
							"click",
							function(e) {
								e.preventDefault();
								$(".content").mCustomScrollbar("scrollTo",
										$(this).attr("href"));
							});

				});
	})(jQuery);
</script>
</head>
<body>
	<!--header-->
	<header>
		<h1>
			<img src="images/admin_logo.png" />
		</h1>
		<ul class="rt_nav">
			<li><a href="#" target="_blank" class="website_icon">站点首页（放全端首页）</a>
			</li>
			<li><a href="../den" class="quit_icon">安全退出</a></li>
		</ul>
	</header>
	<aside class="lt_aside_nav content mCustomScrollbar">
		<h2>
			<a href="index.jsp">起始页</a>
		</h2>
		<ul>
			<li>
   <dl>
    <dt>常用布局示例</dt>
    <dd><a href="../loginpage" class="active">商品列表示例</a></dd>
    <dd><a href="product_detail.jsp">商品详情示例</a></dd>
    <dd><a href="zengjia.jsp">商品增加示例</a></dd>
    <dd><a href="../getpage">商品回收站示例</a></dd>
   </dl>
  </li>
			<li>
				<dl>
					<dt>订单信息</dt>
					<dd>
						<a href="../all">订单列表示例</a>
					</dd>
					<dd>
						<a href="#">订单详情示例</a>
					</dd>
				</dl>
			</li>
			<li>
				<dl>
					<dt>会员管理</dt>
					<dd>
						<a href="../page">会员列表示例</a>
					</dd>
					<dd>
						<a href="user_detail.jsp">添加会员（详情）示例</a>
					</dd>
				</dl>
			</li>
			<li>
				<dl>
					<dt>配送与支付设置</dt>
					<dd>
						<a href="express_list.jsp">配送方式</a>
					</dd>
					<dd>
						<a href="pay_list.jsp">支付方式</a>
					</dd>
				</dl>
			</li>
			<li>
				<p class="btm_infor">熊 版权所有</p>
			</li>
		</ul>
	</aside>

	<section class="rt_wrap content mCustomScrollbar">
		<div class="rt_content">
			<div class="page_title">
				<h2 class="fl">商品回收列表显示</h2>
				<a href="product_detail.jsp" class="fr top_rt_btn add_icon">添加商品</a>
			</div>
			<form action="../getlike" method="post">
				<section class="mtb">
					
					</select> <input type="text" class="textbox textbox_225"
						placeholder="输入产品关键词或产品货号..." name="name" /> <input type="submit"
						value="查询" class="group_btn" />
				</section>
			</form>
			<table class="table">
				<tr>
					<th>缩略图</th>
					<th>产品名称</th>
					<th>货号</th>
					<th>单价</th>
					<th>单位</th>
					<th>库存</th>
					<th>操作</th>
				</tr>
				<c:forEach var="li" items="${list}" varStatus="status">
					<tr>
						<td class="center"><img src="${li.thumbnail}"
							width="50" height="50" /></td>
						<td>${li.pname}</td>
						<td class="center">${li.number}</td>
						<td class="center"><strong class="rmb_icon">${li.price}</strong>
						</td>
						<td class="center">${li.company}</td>
						<td class="center">${li.stock}</td>
						<td class="center">
							</a> <a href="javascript:getdel(${li.id})" title="恢复到产品列表"
							class="link_icon">&#47;</a> 
							<a href="javascript:del(${li.id})"
							title="删除" class="link_icon">&#100;</a></td>
					</tr>
				</c:forEach>

			</table>
			<aside class="paging">
				<a>总页数:${index1}/${total}</a> <a href="../getpage?index=1"> 第一页</a>
				<a href="../getpage?index=${index1-1 }"> 上一页</a> <a
					href="../getpage?index=${index1+1 }"> 下一页</a> <a
					href="../getpage?index=${total}"> 最后一页</a>
			</aside>
		</div>
	</section>
</body>
<script type="text/javascript" src="js/jquery-1.12.4.js"></script>
<script type="text/javascript">
	function del(id) {
		var is = confirm("是否要删除吗? 将会彻底删除!");
		if (is) {
			$.post("../delete", "id=" + id, function(data) {
				if (data != 0) {
					alert("删除成功");
					location.href = "../getpage";
				} else {
					alert("失败");
					location.href = "../getpage";
				}
			});
		}
	}
	
	function getdel(id) {
		var is = confirm("是否要将商品恢复到商品列表?");
		if (is) {
			$.post("../getupdate", "id=" + id, function(data) {
			alert();
				if (data != 0) {
					alert("恢复成功！");
					location.href = "../getpage";
				} else {
					alert("请尽快联系管理员!");
					location.href = "../getpage";
				}
			});
		}
	}
</script>
</html>
